
import React from 'react';
import { GLOBAL } from '../config/global';

import { View, Text, StyleSheet, PixelRatio } from 'react-native';


import Dialog from './DropDownCpt';
import PickerView from './PickerView';
const ScreenWidth = GLOBAL.SCREEN_WIDTH;
const scale = GLOBAL.SCALE;



export default class HoursMinutesCpt extends Dialog {

	constructor(props) {
		super(props);
		this.state = {
			list1: this._generateNunBer(12),
			list2: ['item0', 'item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7', 'item8', 'item9',
				'item10', 'item11', 'item12', 'item13', 'item14', 'item15', 'item16', 'item17', 'item18', 'item19',
				'item20', 'item21', 'item22', 'item23', 'item24', 'item25', 'item26', 'item27', 'item28', 'item29',
				'item30', 'item31', 'item32', 'item33', 'item34', 'item35', 'item36', 'item37', 'item38', 'item39',
				'item40', 'item41', 'item42', 'item43', 'item44', 'item45', 'item46', 'item47', 'item48', 'item49',
				'item50', 'item51', 'item52', 'item53', 'item54', 'item55', 'item56', 'item57', 'item58', 'item59']
		}
	}


	_generateNunBer = (num) => {
		let resultArr = [];
		for (var i = 0; i < num; i++) {
			resultArr.push('item' + i);
		}
		return resultArr
	}



	_modify = () => {


	}


	_confirm = () => {

		this.dismiss();
	}

	_changeData = () => {

	}


	renderContent () {
		let { list1, list2 } = this.state || {};
		return (
			<View>
				{/* <View style={styles.headBox}>
					<Text style={styles.headBoxText} onPress={() => { this.dismiss() }}>取消</Text>
					<Text style={styles.headBoxText} onPress={() => { this.dismiss() }}>确认</Text>
				</View> */}
				<View style={{ width: ScreenWidth, flexDirection: 'row', }}>
					<PickerView
						list={list1}
						onPickerSelected={(toValue) => {
							console.warn(toValue)
						}}
						selectedIndex={0}
						fontSize={14 * scale}
						itemWidth={ScreenWidth / 2}
						itemHeight={40 * scale} />
					<PickerView
						list={list2}
						onPickerSelected={(toValue) => {
							console.warn(toValue)
						}}
						selectedIndex={0}
						fontSize={14 * scale}
						itemWidth={ScreenWidth / 2}
						itemHeight={40 * scale} />
				</View>
			</View>
		)
	}

}

const styles = StyleSheet.create({
	headBox: {
		width: ScreenWidth,
		height: 35 * scale,
		flexDirection: 'row',
		alignItems: 'center',
		backgroundColor: '#fff',
		justifyContent: 'space-around',
		//borderBottomColor: '#e4e4e4',
		//borderBottomWidth: 2 * scale,
	},
	headBoxText: {
		fontSize: 12 * scale
	}
});

